SRCPATH=src/com/googlecode/libspml
BINPATH=bin/com/googlecode/libspml
IFACESRC=$(SRCPATH)/*.java
IMPLSRC=$(SRCPATH)/impl/*.java
SRC=$(IFACESRC) $(IMPLSRC)
IFACEBIN=$(BINPATH)/*.class
IMPLBIN=$(BINPATH)/impl/*.class
BIN=$(IFACEBIN) $(IMPLBIN)
JARFLAGS=cvf
CFLAGS=-d bin -cp bin -deprecation -g -s src -source 7 -target 7 -Xlint
DOCFLAGS=-d doc -sourcepath src -subpackages com.googlecode.libspml

all: libspml-src.jar libspml-bin.jar libspml-doc.jar

libspml-src.jar: $(SRC)
		jar $(JARFLAGS) libspml-src.jar $(SRC)

libspml-bin.jar: bin $(BIN)
		jar $(JARFLAGS) libspml.jar $(BIN)

libspml-doc.jar: doc $(SRC)
		javadoc $(DOCFLAGS)
		jar $(JARFLAGS) libspml-doc.jar doc

$(BIN): $(SRC)
		javac $(CFLAGS) $(SRC)

bin:
	mkdir bin

doc:
	mkdir doc

clean:
	rm -rfv *.jar bin doc
